package com.jichangxiu.server.platform.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.jichangxiu.common.entity.po.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("platform_menu")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "菜单实体")
public class PlatformMenu extends BaseEntity implements Serializable {

    @Schema(description = "部门ID")
    @TableId(value = "menu_id", type = IdType.ASSIGN_UUID)
    private String menuId;

    @Schema(description = "父菜单ID")
    @TableField(value = "parent_id")
    private String parentId;

    @Schema(description = "菜单名称")
    @TableField(value = "name")
    private String name;

    @Schema(description = "菜单路径")
    @TableField(value = "path")
    private String path;

    @Schema(description = "菜单组件")
    @TableField(value = "component")
    private String component;

    @Schema(description = "重定向地址")
    @TableField(value = "redirect")
    private String redirect;

    @Schema(description = "显示顺序")
    @TableField(value = "sort", keepGlobalFormat = true)
    private Double sort;

    @Schema(description = "显示名称")
    @TableField(value = "meta_title")
    private String metaTitle;

    @Schema(description = "显示图标")
    @TableField(value = "meta_icon")
    private String metaIcon;

    @Schema(description = "菜单类型")
    @TableField(value = "meta_type")
    private String metaType;

    @Schema(description = "菜单颜色值")
    @TableField(value = "meta_color")
    private String metaColor;

    @Schema(description = "菜单标签")
    @TableField(value = "meta_tag")
    private String metaTag;

    @Schema(description = "打开子页父页为激活状态，父页路由地址")
    @TableField(value = "meta_active")
    private String metaActive;

    @Schema(description = "是否隐藏菜单（true隐藏 false显示）")
    @TableField(value = "meta_hidden")
    private Boolean metaHidden;

    @Schema(description = "是否隐藏面包屑（true隐藏 false显示）")
    @TableField(value = "meta_hidden_breadcrumb")
    private Boolean metaHiddenBreadcrumb;

    @Schema(description = "是否固定菜单（true固定 false不固定）")
    @TableField(value = "meta_affix")
    private Boolean metaAffix;

    @Schema(description = "是否整页打开路由（true全屏 false不）")
    @TableField(value = "meta_full_page")
    private Boolean metaFullPage;

    @Schema(description = "菜单使用类型")
    @TableField(value = "buy_type")
    private String buyType;

    @Schema(description = "状态（false停用 true正常）")
    @TableField(value = "status")
    private Boolean status;

    @TableLogic
    @Schema(description = "是否删除（0否 1是）")
    @TableField(value = "deleted")
    private String deleted;

    @TableField(exist = false)
    @Schema(description = "子菜单")
    private List<PlatformMenu> subPlatformMenus;

    @TableField(exist = false)
    @Schema(description = "菜单下权限列表")
    private List<PlatformMenuPower> platformMenuPowers;

}
